use "Kenya Violence Survey Experiment Data.dta", clear

set scheme tufte

************
**Figure 1**
************

foreach y of varlist q24a q25a q27 {
keep if `y'<=87
}
foreach y of varlist q24a q25a q27 {
gen `y'_treat_att=treat_att_violence
}
foreach y of varlist q24a q25a q27 {
gen `y'_treat_violence=treat_violence
}
foreach y of varlist q24a q25a q27 {
gen `y'_treat_att_co=treat_att_violence
}
foreach y of varlist q24a q25a q27 {
gen `y'_treat_violence_co=treat_violence
}
lab var q24a_treat_att "Likelihood of voting for candidate"
lab var q25a_treat_att "Likelihood of neighbors voting for candidate"
lab var q27_treat_att "Likelihood of candidate winning election"
lab var q24a_treat_violence "Likelihood of voting for candidate"
lab var q25a_treat_violence "Likelihood of neighbors voting for candidate"
lab var q27_treat_violence "Likelihood of candidate winning election"
lab var q24a_treat_att_co "Likelihood of voting for candidate"
lab var q25a_treat_att_co "Likelihood of neighbors voting for candidate"
lab var q27_treat_att_co "Likelihood of candidate winning election"
lab var q24a_treat_violence_co "Likelihood of voting for candidate"
lab var q25a_treat_violence_co "Likelihood of neighbors voting for candidate"
lab var q27_treat_violence_co "Likelihood of candidate winning election"
foreach y of varlist q24a q25a q27 {
quietly reg `y' `y'_treat_att if treat_non_att_violence==0
estimates store `y'_att
}
foreach y of varlist q24a q25a q27 {
quietly reg `y' `y'_treat_violence if treat_att_violence==0
estimates store `y'_violence
}
foreach y of varlist q24a q25a q27 {
quietly reg `y' `y'_treat_att_co if treat_non_att_violence==0 & treat_coethnic==1
estimates store `y'_att_co
}
foreach y of varlist q24a q25a q27 {
quietly reg `y' `y'_treat_violence_co if treat_att_violence==0 & treat_coethnic==1
estimates store `y'_violence_co
}
coefplot q24a_att q25a_att q27_att q24a_violence q25a_violence q27_violence q24a_att_co q25a_att_co q27_att_co q24a_violence_co q25a_violence_co q27_violence_co, drop(_cons) xline(0) legend(off) pstyle(p1) xscale(range(-5/5)) xlabel(-5/5) headings(q24a_treat_att = "{bf:Attributed Violence}" q24a_treat_violence = "{bf:Any Violence}" q24a_treat_att_co = "{bf:Attributed Violence (Coethnic)}" q24a_treat_violence_co = "{bf:Any Violence (Coethnic)}")

************
**Figure 3**
************

use "Kenya Violence Survey Experiment Data.dta", clear

foreach y of varlist q59a q60a q61 q62 q64 {
keep if `y'<=87
}
foreach y of varlist q59a q60a q61 q62 q64 {
gen `y'_treat=treat2_rhetoric
}
lab var q59a_treat "Likelihood of voting for candidate"
lab var q60a_treat "Likelihood of neighbors voting for candidate"
lab var q61_treat "Likelihood of winning election"
lab var q62_treat "Likelihood of violence"
lab var q64_treat "Violence is sometimes justified"
foreach y of varlist q59a q60a q61 q62 q64 {
quietly reg `y' `y'_treat if treat2_violence!=1 & treat2_rhetoric_violence!=1
estimates store `y'
}
coefplot q59a q60a q61 q62 q64, drop(_cons) xline(0) legend(off) pstyle(p1) xscale(range(-3/3)) xlabel(-3/3) headings(q59a_treat = "{bf:Support for Candidate}" q62_treat = "{bf:Violence}")

************
**Figure 4**
************

**Generate bootstrap sample for violence experiment**
use "Kenya Violence Survey Experiment Data.dta", clear
set seed 321383
keep if q24a<=87 & treat_non_att_violence==0
bootstrap diff=(r(mu_2)-r(mu_1)), size(68) reps(10000): ttest q24a, by(treat_att_violence)
**Generate coethnic bootstrap sample for violence experiment**
use "Kenya Violence Survey Experiment Data.dta", clear
set seed 765887
keep if treat_coethnic==1
keep if q24a<=87 & treat_non_att_violence==0
bootstrap diff=(r(mu_2)-r(mu_1)), size(68) reps(10000): ttest q24a, by(treat_att_violence)
**Generate bootstrap sample for rhetoric experiment**
use "Kenya Violence Survey Experiment Data.dta", clear
drop if treat2_violence==1
set seed 152369
keep if q59a<=87 & treat2_violence!=1
bootstrap diff=(r(mu_2)-r(mu_1)), size(68) reps(10000): ttest q59a, by(treat2_anyrhetoric)
*Plot the bootstrap sample results alongside the elite results (generated in the Kenya Politician Survey Analysis Do file)*
matrix Voters = (-3.621777,-2.2856008,-4.9579532\-3.443396,-2.1654958,-4.7212962\-2.617407,-1.5102552,-3.7245588)
matrix rownames Voters = Violence "Violence (Coethnic)" Rhetoric
matrix colnames Voters = Point Lower Upper
matrix list Voters
matrix Politicians = (-0.1298701,-1.06673,0.8069901\-0.6176471,-1.416882,0.1815882\-0.305,-1.130381,0.5203814)
matrix rownames Politicians = Violence "Violence (Coethnic)" Rhetoric
matrix colnames Politicians = Point Lower Upper
matrix list Politicians
coefplot (matrix(Voters[.,1]), xscale(range(-6/6)) xlabel(-6/6) xline(0) ci((Voters[.,2] Voters[.,3])))
coefplot (matrix(Voters[.,1]), xscale(range(-6/6)) xlabel(-6/6) xline(0) ci((Voters[.,2] Voters[.,3]))) (matrix(Politicians[.,1]), xscale(range(-6/6)) xlabel(-6/6) xline(0) ci((Politicians[.,2] Politicians[.,3])))

****************************
**Online Appendix Table A1**
****************************
use "Kenya Violence Survey Experiment Data.dta", clear
sum age education income_usd tv vehicle phone electricity water owns_home, detail
histogram assets_index, discrete
tab primary_news_source, sort
tab q16, sort
tab q18, sort
sum q19a q19b q19c q19d q19e q19f q19g q19h q19i q19j q19k

*****************************
**Online Appendix Figure A1**
*****************************

use "Kenya Violence Survey Experiment Data.dta", clear
foreach y of varlist sex age education log_income radio tv vehicle phone owns_home computer sat_tv electricity water children q10 q11 q12 q13 q14 q18 q19a q19b q19c q19d q19e q19f q19g q19h q19i q19j q19k {
ttest `y' if `y'<=87 | `y'>=100, by(treat_att_violence)
}
foreach y of varlist sex age education log_income radio tv vehicle phone owns_home computer sat_tv electricity water children q10 q11 q12 q13 q14 q18 q19a q19b q19c q19d q19e q19f q19g q19h q19i q19j q19k {
keep if `y'<=87 | `y'>=100
}
foreach y of varlist sex age education log_income radio tv vehicle phone owns_home computer sat_tv electricity water children q10 q11 q12 q13 q14 q18 q19a q19b q19c q19d q19e q19f q19g q19h q19i q19j q19k {
egen std`y'=std(`y')
}
foreach y of varlist stdsex stdage stdeducation stdlog_income stdradio stdtv stdvehicle stdphone stdowns_home stdcomputer stdsat_tv stdelectricity stdwater stdchildren stdq10 stdq11 stdq12 stdq13 stdq14 stdq18 stdq19a stdq19b stdq19c stdq19d stdq19e stdq19f stdq19g stdq19h stdq19i stdq19j stdq19k {
gen `y'_treat=treat_att_violence
}
lab var stdsex_treat "Sex"
lab var stdage_treat "Age"
lab var stdeducation_treat "Education"
lab var stdlog_income_treat "Income"
lab var stdradio_treat "Radio"
lab var stdtv_treat "TV"
lab var stdvehicle_treat "Vehicle"
lab var stdphone_treat "Phone"
lab var stdowns_home_treat "Homeowner"
lab var stdcomputer_treat "Computer"
lab var stdsat_tv_treat "Sat TV"
lab var stdelectricity_treat "Electricity"
lab var stdwater_treat "Running Water"
lab var stdchildren_treat "No. children"
lab var stdq10_treat "Radio"
lab var stdq11_treat "Newspaper"
lab var stdq12_treat "TV"
lab var stdq13_treat "Friends/family"
lab var stdq14_treat "Local leaders"
lab var stdq18_treat "Purpose of elections"
lab var stdq19a_treat "Importance of managing economy"
lab var stdq19b_treat "Importance of combatting corruption"
lab var stdq19c_treat "Importance of peace/security"
lab var stdq19d_treat "Importance of getting things done"
lab var stdq19e_treat "Importance of tribe"
lab var stdq19f_treat "Importance of services to community"
lab var stdq19g_treat "Importance of gifts during campaign"
lab var stdq19h_treat "Importance of gifts while in office"
lab var stdq19i_treat "Importance of services to country"
lab var stdq19j_treat "Importance of reducing poverty"
lab var stdq19k_treat "Importance of providing assistance"
foreach y of varlist stdsex stdage stdeducation stdchildren stdlog_income stdradio stdtv stdvehicle stdphone stdowns_home stdcomputer stdsat_tv stdelectricity stdwater stdq10 stdq11 stdq12 stdq13 stdq14 stdq18 stdq19a stdq19b stdq19c stdq19d stdq19e stdq19f stdq19g stdq19h stdq19i stdq19j stdq19k {
quietly reg `y' `y'_treat
estimates store `y'
}
coefplot (stdsex) (stdage) (stdeducation) (stdchildren) (stdlog_income) (stdradio) (stdtv) (stdvehicle) (stdphone) (stdowns_home) (stdcomputer) (stdsat_tv) (stdelectricity) (stdwater) (stdq10) (stdq11) (stdq12) (stdq13) (stdq14) (stdq18) (stdq19a) (stdq19b) (stdq19c) (stdq19d) (stdq19e) (stdq19f) (stdq19g) (stdq19h) (stdq19i) (stdq19j) (stdq19k), drop(_cons) xline(0) legend(off) pstyle(p1) headings(stdradio_treat = "{bf:Assets}" stdq10_treat = "{bf:Source of News}" stdq14_treat = "{bf:Political Views}")

*****************************
**Online Appendix Figure A2**
*****************************

use "Kenya Violence Survey Experiment Data.dta", clear
eststo clear
foreach y of varlist sex age education log_income radio tv vehicle phone owns_home computer sat_tv electricity water children q10 q11 q12 q13 q14 q18 q19a q19b q19c q19d q19e q19f q19g q19h q19i q19j q19k {
ttest `y' if `y'<=87 | `y'>=100, by(treat_coethnic)
}
foreach y of varlist stdsex stdage stdeducation stdlog_income stdradio stdtv stdvehicle stdphone stdowns_home stdcomputer stdsat_tv stdelectricity stdwater stdchildren stdq10 stdq11 stdq12 stdq13 stdq14 stdq18 stdq19a stdq19b stdq19c stdq19d stdq19e stdq19f stdq19g stdq19h stdq19i stdq19j stdq19k {
replace `y'_treat=treat_coethnic
}
foreach y of varlist stdsex stdage stdeducation stdchildren stdlog_income stdradio stdtv stdvehicle stdphone stdowns_home stdcomputer stdsat_tv stdelectricity stdwater stdq10 stdq11 stdq12 stdq13 stdq14 stdq18 stdq19a stdq19b stdq19c stdq19d stdq19e stdq19f stdq19g stdq19h stdq19i stdq19j stdq19k {
quietly reg `y' `y'_treat
estimates store `y'
}
coefplot (stdsex) (stdage) (stdeducation) (stdchildren) (stdlog_income) (stdradio) (stdtv) (stdvehicle) (stdphone) (stdowns_home) (stdcomputer) (stdsat_tv) (stdelectricity) (stdwater) (stdq10) (stdq11) (stdq12) (stdq13) (stdq14) (stdq18) (stdq19a) (stdq19b) (stdq19c) (stdq19d) (stdq19e) (stdq19f) (stdq19g) (stdq19h) (stdq19i) (stdq19j) (stdq19k), drop(_cons) xline(0) legend(off) pstyle(p1) headings(stdradio_treat = "{bf:Assets}" stdq10_treat = "{bf:Source of News}" stdq14_treat = "{bf:Political Views}")

*****************************
**Online Appendix Figure A3**
*****************************

use "Kenya Violence Survey Experiment Data.dta", clear
eststo clear
foreach y of varlist sex age education log_income radio tv vehicle phone owns_home computer sat_tv electricity water children q10 q11 q12 q13 q14 q18 q19a q19b q19c q19d q19e q19f q19g q19h q19i q19j q19k {
ttest `y' if `y'<=87 | `y'>=100, by(treat2_rhetoric)
}
foreach y of varlist stdsex stdage stdeducation stdlog_income stdradio stdtv stdvehicle stdphone stdowns_home stdcomputer stdsat_tv stdelectricity stdwater stdchildren stdq10 stdq11 stdq12 stdq13 stdq14 stdq18 stdq19a stdq19b stdq19c stdq19d stdq19e stdq19f stdq19g stdq19h stdq19i stdq19j stdq19k {
replace `y'_treat=treat2_rhetoric
}
foreach y of varlist stdsex stdage stdeducation stdchildren stdlog_income stdradio stdtv stdvehicle stdphone stdowns_home stdcomputer stdsat_tv stdelectricity stdwater stdq10 stdq11 stdq12 stdq13 stdq14 stdq18 stdq19a stdq19b stdq19c stdq19d stdq19e stdq19f stdq19g stdq19h stdq19i stdq19j stdq19k {
quietly reg `y' `y'_treat
estimates store `y'
}
coefplot (stdsex) (stdage) (stdeducation) (stdchildren) (stdlog_income) (stdradio) (stdtv) (stdvehicle) (stdphone) (stdowns_home) (stdcomputer) (stdsat_tv) (stdelectricity) (stdwater) (stdq10) (stdq11) (stdq12) (stdq13) (stdq14) (stdq18) (stdq19a) (stdq19b) (stdq19c) (stdq19d) (stdq19e) (stdq19f) (stdq19g) (stdq19h) (stdq19i) (stdq19j) (stdq19k), drop(_cons) xline(0) legend(off) pstyle(p1) headings(stdradio_treat = "{bf:Assets}" stdq10_treat = "{bf:Source of News}" stdq14_treat = "{bf:Political Views}")

*****************************
**Online Appendix Figure B1**
*****************************

use "Kenya Violence Survey Experiment Data.dta", clear
foreach y of varlist q24a q25a q27 {
keep if `y'<=87
}
foreach y of varlist q24a q25a q27 {
gen `y'_treat_def=treat_def_violence
}
foreach y of varlist q24a q25a q27 {
gen `y'_treat_def_co=treat_def_violence
}
lab var q24a_treat_def "Likelihood of voting for candidate"
lab var q25a_treat_def "Likelihood of neighbors voting for candidate"
lab var q27_treat_def "Likelihood of candidate winning election"
lab var q24a_treat_def_co "Likelihood of voting for candidate"
lab var q25a_treat_def_co "Likelihood of neighbors voting for candidate"
lab var q27_treat_def_co "Likelihood of candidate winning election"
foreach y of varlist q24a q25a q27 {
quietly reg `y' `y'_treat_def if treat_non_att_violence==0 & treat_off_violence==0
estimates store `y'_def
}
foreach y of varlist q24a q25a q27 {
quietly reg `y' `y'_treat_def_co if treat_non_att_violence==0 & treat_off_violence==0 & treat_coethnic==1
estimates store `y'_def_co
}
coefplot q24a_def q25a_def q27_def q24a_def_co q25a_def_co q27_def_co, drop(_cons) xline(0) legend(off) pstyle(p1) xscale(range(-5/5)) xlabel(-5/5) headings(q24a_treat_def = "{bf:Defensive Violence}" q24a_treat_def_co = "{bf:Defensive Violence (Coethnic)}")

*****************************
**Online Appendix Figure B2**
*****************************

use "Kenya Violence Survey Experiment Data.dta", clear
foreach y of varlist q24a q25a q27 {
ttest `y' if `y'<=87 & treat_non_att_violence==0 & treat_coethnic==1 & sex==0 & education<=3 & age<=34, by(treat_att_violence)
}
matrix Voters = (-3.621777,-2.2856008,-4.9579532\-3.443396,-2.1654958,-4.7212962\-2.617407,-1.5102552,-3.7245588)
matrix rownames Voters = Violence "Violence (Coethnic)" Rhetoric
matrix colnames Voters = Point Lower Upper
matrix list Voters
coefplot matrix(Voters[.,1]), xscale(range(-6/6)) xlabel(-6/6) xline(0) coeflabel(Violence-Coethnic = "Violence (Coethnic)") ci((Voters[.,2] Voters[.,3]))

****************************
**Online Appendix Table B1**
****************************

use "Kenya Violence Survey Experiment Data.dta", clear
mean q24a if q24a<=87 & treat_coethnic==1 & treat_off_violence==1
mean q24a if q24a<=87 & treat_coethnic==1 & treat_def_violence==1
mean q24a if q24a<=87 & treat_coethnic==1 & treat_non_att_violence==1
mean q24a if q24a<=87 & treat_coethnic==1 & treat_no_violence==1
mean q24a if q24a<=87 & treat_coethnic==0 & treat_off_violence==1
mean q24a if q24a<=87 & treat_coethnic==0 & treat_def_violence==1
mean q24a if q24a<=87 & treat_coethnic==0 & treat_non_att_violence==1
mean q24a if q24a<=87 & treat_coethnic==0 & treat_no_violence==1
